package dao.impl;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;

import module.Unit;
import dao.ABSBasicDAO;
import domain.vo.queryObject;
/**
 * 
* @ClassName: UnitDAOImpl 
* @Description: 小区DOA
* @author chenchao
* @date 2014年1月16日 下午1:02:46 
*
 */
public class UnitDAOImpl extends ABSBasicDAO<Unit> {
	/**
	 * 构造方法
	 * @param sqlMapClient
	 */
	public UnitDAOImpl(SqlMapClient sqlMapClient) {
		super(sqlMapClient);
	}

	@Override
	public List<Unit> getAll() throws SQLException {
		// TODO Auto-generated method stub
		return super.getAll();
	}

	@Override
	public Unit getById(String id) throws SQLException {
			return (Unit)sqlMapClient.queryForObject("Unit.getById", id);
	}

	@Override
	public Unit getByPK() {
		// TODO Auto-generated method stub
		return super.getByPK();
	}

	@Override
	public void insertT(Unit t) throws SQLException {
		sqlMapClient.insert("Unit.insertUnitInfo",t);
	}

	@Override
	public void updateT(Unit t) throws SQLException {
		sqlMapClient.insert("Unit.updateUnitInfo",t);
	}

	@Override
	public void deleteT(int id) throws SQLException {
		// TODO Auto-generated method stub
		super.deleteT(id);
	}

	@Override
	public List<Unit> getObjectByQueryObject(queryObject queryObject)
			throws SQLException {
		return (List<Unit>)sqlMapClient.queryForList("Unit.getUnitByQueryObject", queryObject);
	}

	@Override
	public int countByQueryObject(queryObject queryObject) throws SQLException {
		return (Integer)sqlMapClient.queryForObject("Unit.countUnitByQueryObject", queryObject);
	}
	
	
	
}
